Skip to content

Lesson1 - #1

Open
wheelman1995 wants to merge 11 commits into
masterfrom
lesson1
Open

Lesson1#1
wheelman1995 wants to merge 11 commits into
masterfrom
lesson1

Conversation

@wheelman1995

Copy link
Copy Markdown
Owner

No description provided.

Comment thread homeworks.iml Outdated
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

смело игнорим)

Comment thread lesson1/lesson1.iml Outdated
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

смело игнорим)

//делая показатель степени чётным и передаём возведение в чётную степень (x^(n-1)) в следующую итерацию метода
//после получения результата умножаем его на основание x - (x * x^(n-1))
//когда показатель степени доходит до 0, возвращаем 1 и идём вверх по итерациям к окончательному результату.
private static <T extends Number> double pow(T base, int exponent) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а входящий Т мы не хотим ограничить числами?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ограничен - T extends Number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants